import json

def dump_list_of_dicts_to_json(data, file_path):
    with open(file_path, 'w', encoding='utf-8') as json_file:
        json.dump(data, json_file, ensure_ascii=False, indent=4)

# Example usage
rules = [
    "preproc_def", "namespace_definition", "function_declarator", "enum_specifier",
    "type_definition", "alias_declaration", "class_specifier", "init_declarator",
    "struct_specifier", "union_specifier", "template_declaration", "declaration",
    "labeled_statement", "field_expression", "call_expression", "qualified_identifier",
    "binary_expression", "constant_expression", "unary_expression"
]


file_path = '/disk0/wyf/Project/zz_static_project/src/data_augmentation/rules/output.json'
dump_list_of_dicts_to_json(rules, file_path)
